package org.artifact.core.context.bytebuf;

import org.artifact.core.lang.DuplexMap;

import java.nio.charset.Charset;

public class ProxyContent {

	// 数据类型
	public static final byte BYTE = 0;

	public static final byte SHORT_16 = 1;
	public static final byte SHORT_8 = 2;

	public static final byte INT_32 = 3;
	public static final byte INT_16 = 4;
	public static final byte INT_8 = 5;

	public static final byte LONG_64 = 6;
	public static final byte LONG_32 = 7;
	public static final byte LONG_16 = 8;
	public static final byte LONG_8 = 9;

	public static final byte FLOAT = 10;

	public static final byte DOUBLE_64 = 11;
	public static final byte DOUBLE_32 = 12;

	public static final byte NULL = 13;
	public static final byte TRUE = 14;
	public static final byte FALSE = 15;
	public static final byte DATE = 16;
	public static final byte STRING = 17;
	public static final byte MAP = 18;
	public static final byte COLLECTION = 19;
	public static final byte ISERIALIZABLE = 20;
	public static final byte ENUM = 21;
	public static final byte ARRAY = 22;
	// 子类型
	public static final DuplexMap<Integer, Byte> INT_SUB_TYPE = new DuplexMap<>();
	public static final DuplexMap<Integer, Byte> STRING_SUB_TYPE = new DuplexMap<>();
	public static final DuplexMap<Integer, Byte> MAP_SUB_TYPE = new DuplexMap<>();
	public static final DuplexMap<Integer, Byte> COLLECTION_SUB_TYPE = new DuplexMap<>();
	
	
	static {
		// Byte子类型 -1~64
		INT_SUB_TYPE.put(-1, (byte)29);
		INT_SUB_TYPE.put(0, (byte)30);
		INT_SUB_TYPE.put(1, (byte)31);
		INT_SUB_TYPE.put(2, (byte)32);
		INT_SUB_TYPE.put(3, (byte)33);
		INT_SUB_TYPE.put(4, (byte)34);
		INT_SUB_TYPE.put(5, (byte)35);
		INT_SUB_TYPE.put(6, (byte)36);
		INT_SUB_TYPE.put(7, (byte)37);
		INT_SUB_TYPE.put(8, (byte)38);
		INT_SUB_TYPE.put(9, (byte)39);
		INT_SUB_TYPE.put(10, (byte)40);
		INT_SUB_TYPE.put(11, (byte)41);
		INT_SUB_TYPE.put(12, (byte)42);
		INT_SUB_TYPE.put(13, (byte)43);
		INT_SUB_TYPE.put(14, (byte)44);
		INT_SUB_TYPE.put(15, (byte)45);
		INT_SUB_TYPE.put(16, (byte)46);
		INT_SUB_TYPE.put(17, (byte)47);
		INT_SUB_TYPE.put(18, (byte)48);
		INT_SUB_TYPE.put(19, (byte)49);
		INT_SUB_TYPE.put(20, (byte)50);
		INT_SUB_TYPE.put(21, (byte)51);
		INT_SUB_TYPE.put(22, (byte)52);
		INT_SUB_TYPE.put(23, (byte)53);
		INT_SUB_TYPE.put(24, (byte)54);
		INT_SUB_TYPE.put(25, (byte)55);
		INT_SUB_TYPE.put(26, (byte)56);
		INT_SUB_TYPE.put(27, (byte)57);
		INT_SUB_TYPE.put(28, (byte)58);
		INT_SUB_TYPE.put(29, (byte)59);
		INT_SUB_TYPE.put(30, (byte)60);
		INT_SUB_TYPE.put(31, (byte)61);
		INT_SUB_TYPE.put(32, (byte)62);


		
		// String子类型 10个中文
		STRING_SUB_TYPE.put(0, (byte)63);
		STRING_SUB_TYPE.put(1, (byte)64);
		STRING_SUB_TYPE.put(2, (byte)65);
		STRING_SUB_TYPE.put(3, (byte)66);
		STRING_SUB_TYPE.put(4, (byte)67);
		STRING_SUB_TYPE.put(5, (byte)68);
		STRING_SUB_TYPE.put(6, (byte)69);
		STRING_SUB_TYPE.put(7, (byte)70);
		STRING_SUB_TYPE.put(8, (byte)71);
		STRING_SUB_TYPE.put(9, (byte)72);
		STRING_SUB_TYPE.put(10, (byte)73);
		STRING_SUB_TYPE.put(11, (byte)74);
		STRING_SUB_TYPE.put(12, (byte)75);
		STRING_SUB_TYPE.put(13, (byte)76);
		STRING_SUB_TYPE.put(14, (byte)77);
		STRING_SUB_TYPE.put(15, (byte)78);
		STRING_SUB_TYPE.put(16, (byte)79);
		STRING_SUB_TYPE.put(17, (byte)80);
		STRING_SUB_TYPE.put(18, (byte)81);
		STRING_SUB_TYPE.put(19, (byte)82);
		STRING_SUB_TYPE.put(20, (byte)83);
		STRING_SUB_TYPE.put(21, (byte)84);
		STRING_SUB_TYPE.put(22, (byte)85);
		STRING_SUB_TYPE.put(23, (byte)86);
		STRING_SUB_TYPE.put(24, (byte)87);
		STRING_SUB_TYPE.put(25, (byte)88);
		STRING_SUB_TYPE.put(26, (byte)89);
		STRING_SUB_TYPE.put(27, (byte)90);
		STRING_SUB_TYPE.put(28, (byte)91);
		STRING_SUB_TYPE.put(29, (byte)92);
		STRING_SUB_TYPE.put(30, (byte)93);



		
		// Map子类型
		MAP_SUB_TYPE.put(0, (byte)94);
		MAP_SUB_TYPE.put(1, (byte)95);
		MAP_SUB_TYPE.put(2, (byte)96);
		MAP_SUB_TYPE.put(3, (byte)97);
		MAP_SUB_TYPE.put(4, (byte)98);
		MAP_SUB_TYPE.put(5, (byte)99);
		MAP_SUB_TYPE.put(6, (byte)100);
		MAP_SUB_TYPE.put(7, (byte)101);
		MAP_SUB_TYPE.put(8, (byte)102);
		MAP_SUB_TYPE.put(9, (byte)103);
		MAP_SUB_TYPE.put(10, (byte)104);
		MAP_SUB_TYPE.put(11, (byte)105);
		MAP_SUB_TYPE.put(12, (byte)106);
		MAP_SUB_TYPE.put(13, (byte)107);
		MAP_SUB_TYPE.put(14, (byte)108);
		MAP_SUB_TYPE.put(15, (byte)109);
		MAP_SUB_TYPE.put(16, (byte)110);


		
		// Collection子类型
		COLLECTION_SUB_TYPE.put(0, (byte)111);
		COLLECTION_SUB_TYPE.put(1, (byte)112);
		COLLECTION_SUB_TYPE.put(2, (byte)113);
		COLLECTION_SUB_TYPE.put(3, (byte)114);
		COLLECTION_SUB_TYPE.put(4, (byte)115);
		COLLECTION_SUB_TYPE.put(5, (byte)116);
		COLLECTION_SUB_TYPE.put(6, (byte)117);
		COLLECTION_SUB_TYPE.put(7, (byte)118);
		COLLECTION_SUB_TYPE.put(8, (byte)119);
		COLLECTION_SUB_TYPE.put(9, (byte)120);
		COLLECTION_SUB_TYPE.put(10, (byte)121);
		COLLECTION_SUB_TYPE.put(11, (byte)122);
		COLLECTION_SUB_TYPE.put(12, (byte)123);
		COLLECTION_SUB_TYPE.put(13, (byte)124);
		COLLECTION_SUB_TYPE.put(14, (byte)125);
		COLLECTION_SUB_TYPE.put(15, (byte)126);
		COLLECTION_SUB_TYPE.put(16, (byte)127);


	}
	
	
	
	
	// byte
	public static final byte BYTE_MIN_VALUE = Byte.MIN_VALUE;
	public static final byte BYTE_MAX_VALUE = Byte.MAX_VALUE;
	// short
	public static final short SHORT_MIN_VALUE = Short.MIN_VALUE;
	public static final short SHORT_MAX_VALUE = Short.MAX_VALUE;
	// int
	public static final int INT_MIN_VALUE = Integer.MIN_VALUE;
	public static final int INT_MAX_VALUE = Integer.MAX_VALUE;
	// long
	public static final long LONG_MIN_VALUE = Long.MIN_VALUE;
	public static final long LONG_MAX_VALUE = Long.MAX_VALUE;
	// float
	public static final float FLOAT_MIN_VALUE = Float.MIN_VALUE;
	public static final float FLOAT_MAX_VALUE = Float.MAX_VALUE;
	// double
	public static final double DOUBLE_MIN_VALUE = Double.MIN_VALUE;
	public static final double DOUBLE_MAX_VALUE = Double.MAX_VALUE;
	
	public static final Charset CHARSET = Charset.forName("UTF-8");
}
